import React from 'react';
import _ from 'underscore';
import View from 'lib/View.jsx';
import DrillScope from './DrillScope.es6';
import Card from 'lib/components/card.jsx';
import ChartWidget from 'lib/components/ChartWidget.jsx';
import GridWidget from 'lib/components/GridWidget.jsx';
import addWidgetMixin from '../common/NewDashboardWidget.jsx'

export default class RootView extends View {
  constructor(props){
    super(props);
  }
  render(){
    return (
      <div className="box">
        <div className="widget-float">
          <div className="widget-title">
            <a className="close iconfont" href="#/">&#xe638;</a>
            <h4>{this.state.title}</h4>
          </div>
          <div className="widget-content">
            <div className="pure-g">
              <div className="pure-u-1">
                <div className="box">
                  <Card title="HTTP 响应时间" extra={
                      addWidgetMixin(this.scope.chart0Api,'HTTP 响应时间')
                    }>
                    <ChartWidget store={this.state.chart0}/>
                  </Card>
                </div>
              </div>
            </div>
            <div className="pure-g">
              <div className="pure-u-1">
                <div className="box">
                  <Card title="网络故障率" extra={
                      addWidgetMixin(this.scope.chart0Api,'网络故障率')
                    }>
                    <ChartWidget store={this.state.chart1}/>
                  </Card>
                </div>
              </div>
            </div>
            <div className="pure-g">
              <div className="pure-u-1">
                <div className="box">
                  <Card title="活跃会话数" extra={
                      addWidgetMixin(this.scope.chart2Api,'活跃会话数')
                    }>
                   <ChartWidget store={this.state.chart2}/>
                  </Card>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    )
  }
}

RootView.defaultProps = {
  Scope:DrillScope
}
